{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <http://www.zhengzhong.net/>

  Created on 2009-04-08.
  $Id$
-->
{% endcomment %}

<div id="photo" class="ajax_box">

  <div class="main">
    {% if resto.photo_type and resto.photo_data %}
      <img src="{{webapp_}}/resto/{{resto.uid}}/photo/" alt="Photo"/>
    {% endif %}
  </div><!--/.main-->
  
  {% if resto.is_manageable %}
  
    <div class="view">
      <div class="toggle_link">
        <a href="javascript:void(0);" onclick="toggleBox('#photo');">[change photo]</a>
      </div>
    </div><!--/.view-->
    
    <div class="edit hidden">
      <form class="form" action="{{webapp_}}/resto/{{resto.uid}}/photo/" method="POST" enctype="multipart/form-data">
        <div>
          Select a photo: <input type="file" name="photo" size="20"/>
        </div>
        {% if resto.photo_type and resto.photo_data %}
          <div>
            <input type="checkbox" name="delete" value="yes"/>
            Delete the photo.
          </div>
        {% else %}
          <input type="hidden" name="delete" value="no"/>
        {% endif %}
        <div>
          <input class="button" type="submit" value="Update"/>
          <input class="button" type="button" onclick="toggleBox('#photo');" value="Cancel"/>
        </div>
      </form>
    </div><!--/.edit-->
  
  {% endif %}

</div><!--/#photo-->



